home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 23.zip
/
BS1 part 23
/
Prof page II util.adf
/
HD
/
HDInstall
< prev
next >
Wrap
AmigaDOS Script File
|
1990-12-17
|
5KB
|
182 lines
.KEY dest,help/s
.BRA {
.KET }
; :ts=3
; HDInstall - Install Professional Page onto a hard drive.
;
; Inputs:
; dest Directory to install PPage into
; help Print instructions
;
;
; Some preliminary setup.
;
ASSIGN PPageInstUtil: PPageUtil: ; Hook we can use when disk has been removed
ASSIGN PPageInstOrig: "" ; Save initial directory
; Make sure he's running WB 1.3!
; Under 1.3, the "1 gt 2" test fails; we proceed to "FAILAT 10".
; Under 1.2, however, the IF command itself dies, since GT is not defined;
; execution is not suspended, and the ECHO and SKIP are seen.
FAILAT 21
IF >NIL: 1 gt 2
ECHO "*NVersion 1.3 of the Amiga Workbench software *E[;1mmust*E[m be"
ECHO "present before this installation can proceed.*N"
SKIP wrapup
ENDIF
FAILAT 10
; Start with a fresh copy, to avoid any screwups
IF EXISTS RAM:PPageInstall
DELETE RAM:PPageInstall/#? quiet
ELSE
MAKEDIR RAM:PPageInstall
ENDIF
IF EXISTS C:COPY
C:COPY C:Copy RAM:PPageInstall
ENDIF
CD ram:PPageInstall ; Search it without adding it to path
IF EXISTS C:Assign
Copy C:Assign RAM:PPageInstall
ENDIF
IF EXISTS C:Echo
Copy C:Echo RAM:PPageInstall
ENDIF
IF EXISTS C:FailAt
Copy C:FailAt RAM:PPageInstall
ENDIF
IF EXISTS C:If
Copy C:If RAM:PPageInstall
ENDIF
IF EXISTS C:Else
Copy C:Else RAM:PPageInstall
ENDIF
IF EXISTS C:Endif
Copy C:Endif RAM:PPageInstall
ENDIF
IF EXISTS C:Makedir
Copy C:Makedir RAM:PPageInstall
ENDIF
IF EXISTS C:Execute
Copy C:Execute RAM:PPageInstall
ENDIF
COPY PPageInstUtil:HD/DiskMount RAM:PPageInstall
COPY PPageInstUtil:HD/InstUtil RAM:PPageInstall
COPY PPageInstUtil:HD/Install-Proc RAM:PPageInstall
Assign PPageInstPgm: ; Make sure these start fresh, too.
Assign PPageInstCG:
;
; Make sure needed system assignments exist.
;
INSTUTIL isdir T:
IF WARN
INSTUTIL isdir RAM:T
IF WARN
MAKEDIR ram:T
ENDIF
ASSIGN T: ram:T
ENDIF
INSTUTIL isdir ENV:
IF WARN
INSTUTIL isdir RAM:ENV
IF WARN
MAKEDIR ram:ENV
ENDIF
ASSIGN ENV: ram:ENV
ENDIF
;
; HELP processing
;
IF "{help}" eq "HELP"
SKIP showme
ENDIF
INSTUTIL ask -dy "Do you need instructions [Y/N]? Y"
IF WARN
SKIP noshow
ENDIF
LAB showme
EXECUTE RAM:PPageInstall/DiskMount Program PPage: PPageInstPgm:
PPageInstPgm:showme PPageInstUtil:HD/HELP-Install
LAB noshow
;
; Make sure that the destination exists, that its name is
; in a useable form (ie. that it ends with a '/' if it's a directory),
; and that the user in fact wants to install into it.
;
IF NOT EXISTS "{dest$SYS:}"
ECHO "*N ********** Couldn't find Hard Disk drawer {dest$SYS:} **********"
SKIP forhelp
ENDIF
INSTUTIL isdir "{dest$SYS:}"
IF WARN
CD RAM:PPageInstall
ECHO "*N ********** {dest$SYS:} is not a drawer! **********"
LAB forhelp
ECHO "*N For help, type"
ECHO " EXECUTE PPageUtil:HD/HDInstall help"
ECHO "*N or double-click on the *"Help*" icon in this drawer*N"
SKIP wrapup
ENDIF
CD RAM:PPageInstall
ECHO "*N Answering *"No*" to the following question will cancel"
ECHO " the installation. Your hard drive will not be changed.*N"
INSTUTIL ask -dy "Install Professional Page onto {dest$SYS:} [Y/N]? Y"
IF warn
ECHO " Installation aborted!*N"
SKIP wrapup
ENDIF
ECHO >ram:PPageInstall/DestPath1 "{dest$SYS:}"
INSTUTIL <ram:PPageInstall/DestPath1 >ram:PPageInstall/DestPath2 fixdir
ASSIGN >nil: PPageInstDest: "{dest$SYS:}"
ECHO "*N*N ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*N"
ECHO " Begin installation of Professional Page onto {dest$SYS:}*N"
INSTUTIL >ram:PPageInstall/TempScript mergenl "==EXECUTE >nil: ram:PPageInstall/Install-Proc """ ram:PPageInstall/DestPath2 "=="""
EXECUTE ram:PPageInstall/TempScript
ECHO "*N*N --------------------------------------------------------------------"
ECHO " Please add the following command to the file s:Startup-sequence:"
ECHO "*N Execute s:PPageStartup"
ECHO "*N --------------------------------------------------------------------"
ECHO "*N*N Installation of Professional Page complete."
ECHO "*N ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*N"
;
; Clean up after ourselves
; Can't depend on anything but PPageInstOrig: and PPageInstUtil:,
; since we can come here from right after their definition.
;
LAB wrapup
CD PPageInstOrig:
Assign PPageInstOrig:
Assign PPageInstPgm:
Assign PPageInstCG:
Assign PPageInstDest:
DELETE >NIL: RAM:PPageInstall all quiet
PPageInstUtil:HD/InstUtil ask "Press RETURN."
Assign PPageInstUtil: